<!DOCTYPE html>
<html>
<head>
    <title>新增减免人登记</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <blockquote class="layui-elem-quote layui-bg-white">
        <#if (house.id != 0)>房源信息：【安置项目：<span class="jmdf-color-red">${(house.azProject.projectName)!}</span>】【幢号：<span
                class="jmdf-color-red">${(house.buildNum)!}</span>】【户号：<span
                class="jmdf-color-red">${(house.houseNum)!}</span>】</#if>
    </blockquote>
    <div class="layui-row  layui-col-space10">
        <div class="layui-col-xs12">
            <div class="layui-card">
                <form class="layui-form" action="">
                    <input type="hidden" name="houseId" value="${(house.id)!}"/>
                    <input type="hidden" name="housePersonForPropertyId" value="${(housePersonForProperty.id)!}"/>

                    <div class="layui-form-item jmdf-color-red" style="text-align: center">
                       请录入单个人名信息！！！
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">减免人姓名：</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" id="name" lay-verify="required"
                                   value="${(housePersonForProperty.name)!}" autocomplete="off" placeholder="必填项"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">减免人身份证号：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="idCard"
                                   value="${(housePersonForProperty.idCard)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">减免面积：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="freeArea"
                                   value="${(housePersonForProperty.freeArea)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开始减免时间：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" id="startDate" name="startDate" lay-verify="required"
                                   value="${(housePersonForProperty.startDate?string('yyyy-MM-dd'))!}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">减免终止时间：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" id="stopDate" name="stopDate"
                                   value="${(housePersonForProperty.stopDate?string('yyyy-MM-dd'))!}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">产权人关系：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off"
                                   name="relation" value="${(housePersonForProperty.relation)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">备注：</label>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea" name="memo">${(housePersonForProperty.memo)!}</textarea>
                        </div>
                    </div>

                    <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit=""
                            lay-filter="submit">立即提交
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', 'jquery', 'jmdf', 'verify','laydate'], function () {
        var form = layui.form, $ = layui.jquery, jmdf = layui.jmdf, verify = layui.verify,laydate = layui.laydate,
                parentIndex = parent.layer.getFrameIndex(window.name);

        laydate.render({
            elem: '#startDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#stopDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });

        form.on('submit(submit)', function (data) {
            $.ajax({
                url: "housePersonForPropertySave"
                , type: "post"
                , data: data.field
                , success: function (data) {
                    if (data.code == "0001") {
                        layer.alert("配置成功！")
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2});
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>